package util

import (
	"log"
	"strconv"
	"strings"
)

// IntToString 将整数转换为字符串
func IntToString(i int) string {
	return strconv.Itoa(i)
}

// BoolToString 将布尔值转换为字符串
func BoolToString(b bool) string {
	if b {
		return "true"
	}
	return "false"
}

// SendMarkdownMessage 发送markdown格式消息
func SendMarkdownMessage(title, content, channel string) {
	// 格式化消息
	messages := []map[string]interface{}{}

	for _, line := range strings.Split(strings.TrimSpace(content), "\n") {
		messages = append(messages, map[string]interface{}{
			"tag":  "text",
			"text": strings.TrimSpace(line),
		})
		log.Printf("发送消息: %s -> %s", title, messages)
	}

	log.Printf("发送消息: %s -> %s", title, content)

	// TODO: 实现实际的消息发送逻辑
}
